<template>
  <div class="tabbar">
    <div :class="{active:index==light}" @click="highlight(index)" v-for="(item,index) in arr" :key="index">{{item}}</div>
  </div>
</template>

<script>
export default {
    data() {
        return {
            light:0,
            arr:['首页','订单','我的']
        }
    },
    methods: {
        
        highlight(index) {
            return this.light=index;
        }
    }
}
</script>

<style scoped lang="scss">
.tabbar{
    display: flex;
    justify-content: space-evenly;
    position:fixed;
    bottom: 0;
    border-top: 1px solid black;
    width: 100%;
    height: 40px;
}
.tabbar div{
    line-height: 40px;
}
.active{
    color: aqua;
}
</style>